# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit udev cmake

DESCRIPTION="stlink is an open source toolset to program and debug STM32 devices"

HOMEPAGE="https://github.com/stlink-org/stlink"

SRC_URI="https://github.com/stlink-org/stlink/archive/refs/tags/v${PV}.tar.gz -> ${PF}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"

RDEPEND="virtual/libusb"
DEPEND="${RDEPEND}"

src_configure() {
	cmake_src_configure
}

src_compile() {
	emake release
	emake debug
}

pkg_postinst() {
	udev_reload
}

pkg_postrm() {
	udev_reload
}
